﻿@using BootstrapMvc.Models
@model BootstrapMvc.Models.SearchModel

@{
    Layout = null;
}

<!DOCTYPE html>

<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="~/Scripts/bootstrap-3.3.5-dist/js/bootstrap.js"></script>
<script src="~/Scripts/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
<script src="~/Scripts/bootstrap-3.3.5-dist/js/npm.js"></script>
<link href="~/Scripts/bootstrap-3.3.5-dist/css/bootstrap-theme.css" rel="stylesheet" />
<link href="~/Scripts/bootstrap-3.3.5-dist/css/bootstrap-theme.min.css" rel="stylesheet" />
<link href="~/Scripts/bootstrap-3.3.5-dist/css/bootstrap.css" rel="stylesheet" />
<link href="~/Scripts/bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet" />

<link rel="shortcut icon" href="http://www.zi-han.net/theme/hplus/favicon.ico"> <link href="http://www.zi-han.net/theme/hplus/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="http://www.zi-han.net/theme/hplus/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<link href="http://www.zi-han.net/theme/hplus/css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="http://www.zi-han.net/theme/hplus/css/animate.min.css" rel="stylesheet">
<link href="http://www.zi-han.net/theme/hplus/css/style.min.css?v=4.1.0" rel="stylesheet">
<script src="~/Scripts/bootstrap-3.3.5-dist/layer.js"></script>
<link href="~/Scripts/bootstrap-3.3.5-dist/layer.css" rel="stylesheet" />


@{
    var resultList = ViewBag.ResultList as List<IndexModel> ?? new List<IndexModel>();
    <div class="ibox-content">
        <form role="form" class="form-inline">
            <div class="form-group col-md-2">
                <label class="sr-only-focusable ">姓名:</label>
                @Html.TextBoxFor(t => t.Name, new { @class = " form-control " })
            </div>
            <div class="form-group col-md-2">
                <label class="sr-only-focusable">工号:</label>
                @Html.TextBoxFor(t => t.Num, new { @class = "form-control" })
            </div>

            <button class="btn btn-primary " type="submit">查询</button>
            <button class="btn btn-primary " onclick="addNew()" type="button">新增</button>
        </form>
    </div>


    <div class="col-sm-6">
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <th>工号</th>
                    <th>姓名</th>
                    <th>年龄</th>
                    <th>地址</th>
                    <th>电话</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in resultList)
                {
                    <tr>
                        <td>
                            @item.Num
                        </td>
                        <td>
                            @item.Name
                        </td>
                        <td>
                            @item.Age
                        </td>
                        <td>
                            @item.Address
                        </td>
                        <td>
                            @item.Tel
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
    <div id="tanchuceng" class="modal hide fade in" tabindex="-1" role="dialog" style="display:none;" >

    </div>
}

<script type="text/javascript">
    function addNew() {
        var url = "@Url.Content("~/Homework/Show")" ;
        $.ajax({
            type: "GET",
            url: url,
            success: function (data) {
                $("#tanchuceng").empty();
                $("#tanchuceng").append(data);
                parent.layer.open({
                    type: 1,
                    skin: 'layui-layer-rim', //加上边框
                    area: ['420px', '240px'], //宽高
                    shadeClose: true,
                    content: $("#tanchuceng").html()
                });
            },
            dataType: "html"
        });
    }

</script>
